package com.zeratul.common.satoken.domain.entity;

import cn.hutool.core.convert.Convert;
import com.zeratul.common.satoken.domain.entity.base.LoginUserAdapter;
import com.zeratul.common.satoken.enums.UserType;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class SysUser extends LoginUserAdapter {

    /**
     * 用户ID
     */
    private Long sysUserId;

    /**
     * 用户名
     */
    private String username;

    /**
     * 返回用户ID
     */
    @Override
    public String getUserId() {
        return Convert.toStr(sysUserId);
    }

    /**
     * 返回用户类型
     */
    @Override
    public UserType getUserType() {
        return UserType.SYS_USER;
    }
}
